<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>{$site_info.site_seo_title|default=''}</title>
    <meta name="keywords" content="{$site_info.site_seo_keywords|default=''}"/>
    <meta name="description" content="{$site_info.site_seo_description|default=''}"/>
    <link rel="stylesheet" href="/static/layui/css/layui.css">
    <link rel="stylesheet" href="/static/fly/css/global.css">
</head>
<body>
{include file='common/header' /}
{include file='common/nav' /}
<div class="layui-container">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md8 content detail">
            <div class="fly-panel detail-box">
                <h1>{$article.title}</h1>
                <div class="fly-detail-info">
                    {if $article.status==2}
                    <span class="layui-badge" style="background-color: #5FB878;">已结</span>
                    {else}
                    <span class="layui-badge" style="background-color: #999;">未结</span>
                    {/if}
                    {if $article.stick}
                    <span class="layui-badge layui-bg-black">置顶</span>
                    {/if}
                    {if $article.digest}
                    <span class="layui-badge layui-bg-red">精帖</span>
                    {/if}
                    {if auth()->check()}
                    <div class="fly-admin-box" data-id="123">
                        <span class="layui-btn layui-btn-xs jie-admin" type="edit">编辑</span>

                        <span class="layui-btn layui-btn-xs jie-admin" type="del">删除</span>

                        <span class="layui-btn layui-btn-xs jie-admin" type="set" field="stick" rank="1">置顶</span>
                        <!-- <span class="layui-btn layui-btn-xs jie-admin" type="set" field="stick" rank="0" style="background-color:#ccc;">取消置顶</span> -->

                        <span class="layui-btn layui-btn-xs jie-admin" type="set" field="status" rank="1">加精</span>
                        <!-- <span class="layui-btn layui-btn-xs jie-admin" type="set" field="status" rank="0" style="background-color:#ccc;">取消加精</span> -->
                    </div>
                    {/if}
                    <span class="fly-list-nums">
                        <a href="#comment"><i class="iconfont" title="回答">&#xe60c;</i>{$article.comment_count}</a>
                        <i class="iconfont" title="人气">&#xe60b;</i> {$article.read_count}
                    </span>
                </div>
                <div class="detail-about">
                    <a class="fly-avatar" href="/user/{$article.user_id}">
                        <img src="{$article.user.avatar}" alt="">
                    </a>
                    <div class="fly-detail-user">
                        <a href="/user/{$article.user_id}" class="fly-link">
                            <cite>{$article.user.username}</cite>
                            <i class="iconfont icon-renzheng" title="认证信息：作者"></i>
                            <i class="layui-badge fly-badge-vip">VIP1</i>
                        </a>
                        <span>{$article.updated_at}</span>
                    </div>
                    {if $article.score}
                    <div class="detail-hits" id="LAY_jieAdmin" data-id="123">
                        <span style="padding-right: 10px; color: #FF7200">悬赏：{$article.score}积分</span>
                    </div>
                    {/if}
                </div>
                <div class="detail-body photos">
                    {$article.content|raw}
                </div>
            </div>

            <div class="fly-panel detail-box" id="flyReply">
                <fieldset class="layui-elem-field layui-field-title" style="text-align: center;">
                    <legend>回帖</legend>
                </fieldset>

                <ul class="jieda" id="jieda">
                    {foreach $comments as $comment}
                    <li data-id="{$comment->id}" class="jieda-daan">
                        <a name="item-{$comment->id}"></a>
                        <div class="detail-about detail-about-reply">
                            <a class="fly-avatar" href="">
                                <img src="{$comment->user->avatar}" alt=" ">
                            </a>
                            <div class="fly-detail-user">
                                <a href="" class="fly-link">
                                    <cite>{$comment->user->username}</cite>
                                    <i class="iconfont icon-renzheng" title="认证信息：作者"></i>
                                    <i class="layui-badge fly-badge-vip">VIP1</i>
                                </a>
                                <!--
                                <span>(楼主)</span>
                                <span style="color:#5FB878">(管理员)</span>
                                <span style="color:#FF9E3F">（社区之光）</span>
                                <span style="color:#999">（该号已被封）</span>
                                -->
                            </div>

                            <div class="detail-hits">
                                <span>{$comment->created_at}</span>
                            </div>
                            {if $comment->status == 2}
                            <i class="iconfont icon-caina" title="最佳答案"></i>
                            {/if}
                        </div>
                        <div class="detail-body jieda-body photos">
                            <p>{$comment->content}</p>
                        </div>
                        <div class="jieda-reply">
                            <span class="jieda-zan zanok" type="zan">
                                <i class="iconfont icon-zan"></i>
                                <em>{$comment->like}</em>
                            </span>
                            <span type="reply">
                                <i class="iconfont icon-svgmoban53"></i>
                                回复
                            </span>
                            {if $comment.user_id == $article.user_id}
                            <div class="jieda-admin">
                                {if $article.user_id == auth()->id()}
                                <span type="edit">编辑</span>
                                <span type="del">删除</span>
                                {/if}
                                {if $article.status == 1}
                                <span class="jieda-accept" type="accept">采纳</span>
                                {/if}
                            </div>
                            {/if}
                        </div>
                    </li>
                    {/foreach}
                    {if empty($comments)}<li class="fly-none">消灭零回复</li>{/if}
                </ul>

                <div class="layui-form layui-form-pane">
                    <form action="/article/reply" method="post">
                        <div class="layui-form-item layui-form-text">
                            <a name="comment"></a>
                            <div class="layui-input-block">
                                <textarea id="L_content" name="content" required lay-verify="required"
                                          placeholder="请输入内容" class="layui-textarea fly-editor"
                                          style="height: 150px;"></textarea>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <input type="hidden" name="article_id" value="{$article.id}">
                            <button class="layui-btn" lay-filter="*" lay-submit>提交回复</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
        <div class="layui-col-md4">
            {include file='common/right' /}
        </div>
    </div>
</div>
{include file='common/footer' /}
</body>
</html>
